package com.qianyu.api.controller.comm;

import com.qianyu.core.entity.bean.QqAccount;
import com.qianyu.core.service.QqAccountService;
import com.qianyu.core.util.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Api(tags = "公共导出", description = "wangzhicheng")
@RestController
@RequestMapping("/api/es_excel")
@RequiredArgsConstructor
public class ExportController {

    private final QqAccountService qqAccountService;

    /**
     * 导出登录值
     */
    @ApiOperation(value = "导出登录值")
    @GetMapping(value = "/export_login_val")
    public void exportExcel(HttpServletResponse response) throws IOException {
        ExcelUtil.exportExcel(qqAccountService.exportAccount(), "登录值", "登录值", QqAccount.class, "登录值", response);
    }
}

